package itmayiedu.api.fallback;

import com.itmayiedu.base.BaseApiService;
import com.itmayiedu.base.ResponseBase;
import entity.UserEntity;
import itmayiedu.api.feign.MemberServiceFeign;
import org.springframework.stereotype.Component;

/**
 * @description: 会员接口feign客户端, 统一处理服务降级友好提示
 * @author: liucancan
 * @create: 2018-11-12 15:09
 **/
@Component
public class MemberServiceFeignFallback extends BaseApiService implements MemberServiceFeign {

    @Override
    public UserEntity getMember() {
        return null;
    }

    /**
     * 服务降级友好提示
     */
    @Override
    public ResponseBase getUserInfo() {
        return setResultError("第二种使用hystrix服务降级生效了。服务器忙，请稍后重试");
    }
}
